<?php
$this->breadcrumbs=array(
	'Admin'=>array('index'),
	'Task Item',
);

include("left.php");

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('person-task-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => 'a[rel=group]','config' => array('width'=>800,'height'=>600)));
?>

<h1>Manage Person Tasks</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>



<?php $this->widget('zii.widgets.grid.CGridView', array(
	'afterAjaxUpdate'=>"function(id,data){ $('a[rel=group]').fancybox({'width':800,'height':600}); }",
	'id'=>'person-task-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'pdid' => array(
			'name' => 'pdid',
			'header' => 'JID',
			'headerHtmlOptions' => array('width' => '6%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		'username' => array(
			'name' => 'username',
			'header' => 'Code',
			'headerHtmlOptions' => array('width' => '6%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		'office' => array(
			'name' => 'office',
			'header' => 'Office',
			'headerHtmlOptions' => array('width' => '8%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		'job' => array(
			'name' => 'job',
			'header' => 'Job',
			'headerHtmlOptions' => array('width' => '20%'),
			'htmlOptions' => array('style' => 'text-align:left;')
		),
		'type' => array(
			'name' => 'type',
			'header' => 'Periodic',
			'headerHtmlOptions' => array('width' => '6%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		'task' => array(
			'name' => 'task',
			'header' => 'Task',
			'headerHtmlOptions' => array('width' => '20%'),
			'htmlOptions' => array('style' => 'text-align:left;')
		),
		'urgency' => array(
			'name' => 'urgency',
			'header' => 'Urgency',
			'headerHtmlOptions' => array('width' => '6%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		'tcode' => array(
			'name' => 'tcode',
			'header' => 'Tcode',
			'headerHtmlOptions' => array('width' => '6%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		'subcode' => array(
			'name' => 'subcode',
			'header' => 'Subcode',
			'headerHtmlOptions' => array('width' => '6%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		'ptstatus' => array(
			'name' => 'ptstatus',
			'header' => '状态',
			'headerHtmlOptions' => array('width' => '6%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		'ptstatus' => array(
			'name' => 'ptstatus',
			'header' => '状态',
			'headerHtmlOptions' => array('width' => '6%'),
			'htmlOptions' => array('style' => 'text-align:center;')
		),
		array(
            'class' => 'CLinkColumn',
            'header' => '操作', //显示表名称
            'headerHtmlOptions' => array('width'=>'10%'),
            'labelExpression' => '详情', //显示名称
            'urlExpression' => 'Yii::app()->createUrl("personTask/popView",array("id"=>$data->ptid))', //显示URL
//            'urlExpression' => 'Yii::app()->createUrl("personTask/view",array("id"=>$data->ptid))', //显示URL
            'linkHtmlOptions' => array('rel' => 'group','class'=>'iframe'),
            'htmlOptions' => array('style'=>'text-align:center;'),
        ),
	),
)); ?>
